#include <string.h>
#include "gtkcssenumvalueprivate.h"
+#include "gtkcssiconthemevalueprivate.h"
#include "gtkiconfactory.h"
#include "gtkiconcache.h"
#include "gtkdebug.h"
GdkPixbuf *pixbuf;
GdkPixbuf *tmp_pixbuf;
GtkIconSource tmp_source;
- GdkScreen *screen;
GtkIconTheme *icon_theme;
gint width, height, pixel_size;
gint *sizes, *s, dist;
GError *error = NULL;
- screen = gtk_style_context_get_screen (context);
- icon_theme = gtk_icon_theme_get_for_screen (screen);
+ icon_theme = gtk_css_icon_theme_value_get_icon_theme
+ (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_ICON_THEME));
if (!gtk_icon_size_lookup (size, &width, &height))
{
#include "gtknumerableicon.h"
#include "gtknumerableiconprivate.h"
+#include "gtkcssiconthemevalueprivate.h"
#include "gtkicontheme.h"
#include "gtkintl.h"
+#include "gtkstylepropertyprivate.h"
#include "gtkwidget.h"
#include "gtkwidgetpath.h"
#include "gtkwindow.h"
draw_from_gicon (GtkNumerableIcon *self)
{
GtkIconTheme *theme;
- GdkScreen *screen;
GtkIconInfo *info;
GdkPixbuf *pixbuf;
cairo_surface_t *surface;
if (self->priv->style != NULL)
{
- screen = gtk_style_context_get_screen (self->priv->style);
- theme = gtk_icon_theme_get_for_screen (screen);
+ theme = gtk_css_icon_theme_value_get_icon_theme
+ (_gtk_style_context_peek_property (self->priv->style, GTK_CSS_PROPERTY_ICON_THEME));
}
else
{
return _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_ICON_THEME);
}
+GtkIconTheme *
+gtk_css_icon_theme_value_get_icon_theme (GtkCssValue *value)
+{
+ g_return_val_if_fail (value->class == >K_CSS_VALUE_ICON_THEME, NULL);
+
+ return value->icontheme;
+}
#ifndef __GTK_CSS_ICON_THEME_VALUE_PRIVATE_H__
#define __GTK_CSS_ICON_THEME_VALUE_PRIVATE_H__
+#include "gtkicontheme.h"
+
#include "gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
GtkCssValue * _gtk_css_icon_theme_value_new (void);
+GtkIconTheme * gtk_css_icon_theme_value_get_icon_theme (GtkCssValue *value);
+
G_END_DECLS
#endif /* __GTK_CSS_ICON_THEME_VALUE_PRIVATE_H__ */
#include <math.h>
+#include "gtkcssiconthemevalueprivate.h"
#include "gtkcssrgbavalueprivate.h"
#include "gtksettingsprivate.h"
#include "gtkstyleproviderprivate.h"
{
GtkCssImageIconTheme *icon_theme = GTK_CSS_IMAGE_ICON_THEME (image);
GtkCssImageIconTheme *copy;
- GtkSettings *settings;
- GdkScreen *screen;
-
- settings = _gtk_style_provider_private_get_settings (provider);
- if (settings == NULL)
- screen = gdk_screen_get_default ();
- else
- screen = _gtk_settings_get_screen (settings);
copy = g_object_new (GTK_TYPE_CSS_IMAGE_ICON_THEME, NULL);
copy->name = g_strdup (icon_theme->name);
- copy->icon_theme = gtk_icon_theme_get_for_screen (screen);
+ copy->icon_theme = gtk_css_icon_theme_value_get_icon_theme (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_THEME));
copy->scale = _gtk_style_provider_private_get_scale (provider);
copy->color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR));
#include "gtkcellrenderertext.h"
#include "gtkcellrendererpixbuf.h"
#include "gtkcombobox.h"
+#include "gtkcssiconthemevalueprivate.h"
#include "gtkdnd.h"
#include "gtkicontheme.h"
#include "deprecated/gtkiconfactory.h"
static GtkIconTheme *
get_icon_theme (GtkWidget *widget)
{
- if (gtk_widget_has_screen (widget))
- return gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
-
- return gtk_icon_theme_get_default ();
+ return gtk_css_icon_theme_value_get_icon_theme
+ (_gtk_style_context_peek_property (gtk_widget_get_style_context (widget), GTK_CSS_PROPERTY_ICON_THEME));
}
if (!label)
label = _gtk_file_chooser_label_for_file (file);
- icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (button)));
+ icon_theme = get_icon_theme (GTK_WIDGET (button));
surface = gtk_icon_theme_load_surface (icon_theme, "folder-remote",
button->priv->icon_size,
gtk_widget_get_scale_factor (GTK_WIDGET (button)),
if (!label)
label = _gtk_file_chooser_label_for_file (file);
- icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (button)));
+ icon_theme = get_icon_theme (GTK_WIDGET (button));
if (g_file_is_native (file))
surface = gtk_icon_theme_load_surface (icon_theme, "folder",
#include "config.h"
-#include <string.h>
+#include "gtkfilesystem.h"
+#include <string.h>
#include <glib/gi18n-lib.h>
#include "gtkfilechooser.h"
-#include "gtkfilesystem.h"
-#include "gtkicontheme.h"
-#include "gtkprivate.h"
+#include "gtkcssiconthemevalueprivate.h"
#include "gtkintl.h"
+#include "gtkprivate.h"
+#include "gtkstylecontextprivate.h"
/* #define DEBUG_MODE */
#ifdef DEBUG_MODE
gint icon_size,
GError **error)
{
- GdkScreen *screen;
+ GtkStyleContext *context;
GtkIconTheme *icon_theme;
GtkIconInfo *icon_info;
GdkPixbuf *pixbuf;
cairo_surface_t *surface;
- screen = gtk_widget_get_screen (GTK_WIDGET (widget));
- icon_theme = gtk_icon_theme_get_for_screen (screen);
+ context = gtk_widget_get_style_context (widget);
+ icon_theme = gtk_css_icon_theme_value_get_icon_theme
+ (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_ICON_THEME));
icon_info = gtk_icon_theme_lookup_by_gicon_for_scale (icon_theme,
icon,
return NULL;
pixbuf = gtk_icon_info_load_symbolic_for_context (icon_info,
- gtk_widget_get_style_context (widget),
+ context,
NULL,
error);
#include <math.h>
#include "gtkcssenumvalueprivate.h"
+#include "gtkcssiconthemevalueprivate.h"
#include "gtkrender.h"
#include "gtkstylecontextprivate.h"
#include "deprecated/gtkstock.h"
GtkIconLookupFlags flags;
cairo_surface_t *surface;
- icon_theme = gtk_icon_theme_get_for_screen (gtk_style_context_get_screen (context));
+ icon_theme = gtk_css_icon_theme_value_get_icon_theme
+ (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_ICON_THEME));
flags = get_icon_lookup_flags (self, context);
ensure_icon_size (self, &width, &height);
#include "gtkmountoperationprivate.h"
#include "gtkbox.h"
+#include "gtkcssiconthemevalueprivate.h"
#include "gtkdbusgenerated.h"
#include "gtkentry.h"
#include "gtkbox.h"
#include "gtkmenuitem.h"
#include "gtkmain.h"
#include "gtksettings.h"
+#include "gtkstylecontextprivate.h"
#include <glib/gprintf.h>
if (pixbuf == NULL)
{
GtkIconTheme *theme;
- theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (mount_operation->priv->dialog)));
+ theme = gtk_css_icon_theme_value_get_icon_theme
+ (_gtk_style_context_peek_property (gtk_widget_get_style_context (GTK_WIDGET (mount_operation->priv->dialog)),
+ GTK_CSS_PROPERTY_ICON_THEME));
pixbuf = gtk_icon_theme_load_icon (theme,
"application-x-executable",
24,
#include "gtkcheckmenuitem.h"
#include "gtkclipboard.h"
#include "gtkcomboboxtext.h"
+#include "gtkcssiconthemevalueprivate.h"
#include "gtkdragsource.h"
#include "gtkentry.h"
#include "gtkeventbox.h"
#include "gtkseparatormenuitem.h"
#include "gtksizegroup.h"
#include "gtksizerequest.h"
+#include "gtkstylecontextprivate.h"
#include "gtktreemodelsort.h"
#include "gtktreemodelfilter.h"
#include "gtktreeselection.h"
static GtkIconTheme *
get_icon_theme_for_widget (GtkWidget *widget)
{
- if (gtk_widget_has_screen (widget))
- return gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
-
- return gtk_icon_theme_get_default ();
+ return gtk_css_icon_theme_value_get_icon_theme
+ (_gtk_style_context_peek_property (gtk_widget_get_style_context (widget),
+ GTK_CSS_PROPERTY_ICON_THEME));
}
static gint
#include "gtkaccelgroupprivate.h"
#include "gtkbindings.h"
#include "gtkcsscornervalueprivate.h"
+#include "gtkcssiconthemevalueprivate.h"
#include "gtkcssrgbavalueprivate.h"
#include "gtkcssshadowsvalueprivate.h"
#include "gtkkeyhash.h"
gint *sizes;
gint i;
- icon_theme = gtk_icon_theme_get_for_screen (_gtk_window_get_screen (window));
+ icon_theme = gtk_css_icon_theme_value_get_icon_theme
+ (_gtk_style_context_peek_property (gtk_widget_get_style_context (GTK_WIDGET (window)),
+ GTK_CSS_PROPERTY_ICON_THEME));
sizes = gtk_icon_theme_get_icon_sizes (icon_theme, name);
g_list_free_full (icon_list, g_object_unref);
- icon_theme = gtk_icon_theme_get_for_screen (_gtk_window_get_screen (window));
+ icon_theme = gtk_css_icon_theme_value_get_icon_theme
+ (_gtk_style_context_peek_property (gtk_widget_get_style_context (GTK_WIDGET (window)),
+ GTK_CSS_PROPERTY_ICON_THEME));
g_signal_connect (icon_theme, "changed",
G_CALLBACK (update_themed_icon), window);
}
{
GtkIconTheme *icon_theme;
- icon_theme = gtk_icon_theme_get_for_screen (_gtk_window_get_screen (window));
+ icon_theme = gtk_css_icon_theme_value_get_icon_theme
+ (_gtk_style_context_peek_property (gtk_widget_get_style_context (GTK_WIDGET (window)),
+ GTK_CSS_PROPERTY_ICON_THEME));
g_signal_handlers_disconnect_by_func (icon_theme, update_themed_icon, window);
}